package com.empire.module.member.dal.mysql.mappolygonlog;

import java.util.*;

import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.member.dal.dataobject.mappolygonlog.MapPolygonLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.member.controller.admin.mappolygonlog.vo.*;

/**
 * 多边形操作日志 Mapper
 *
 * @author 主席大人
 */
@Mapper
public interface MapPolygonLogMapper extends BaseMapperX<MapPolygonLogDO> {

    default PageResult<MapPolygonLogDO> selectPage(MapPolygonLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MapPolygonLogDO>()
                .eqIfPresent(MapPolygonLogDO::getPolygonId, reqVO.getPolygonId())
                .eqIfPresent(MapPolygonLogDO::getOperateType, reqVO.getOperateType())
                .eqIfPresent(MapPolygonLogDO::getContent, reqVO.getContent())
                .eqIfPresent(MapPolygonLogDO::getOperatorId, reqVO.getOperatorId())
                .likeIfPresent(MapPolygonLogDO::getOperatorName, reqVO.getOperatorName())
                .betweenIfPresent(MapPolygonLogDO::getOperateTime, reqVO.getOperateTime())
                .eqIfPresent(MapPolygonLogDO::getIp, reqVO.getIp())
                .orderByDesc(MapPolygonLogDO::getId));
    }

}